import PropsType from "prop-types";
import SwitchTabs from "../../SwtichTabs/SwtichTabs";

const MySwitchTabs = ({field, tabList, setFieldValue}) => {
  return (
    <SwitchTabs
      {...field}
      value={field.value}
      tabList={tabList}
      onChange={(value) => {
        setFieldValue(field.name, value)
      }}
    />
  )
}

MySwitchTabs.propTypes = {
  field: PropsType.object.isRequired,
  tabList: PropsType.array.isRequired
}

export default MySwitchTabs